<template>
  <div id="container" class="radar-echart"></div>
</template>

<script>
//import echarts from "echarts";

export default {
  data() {
    return {
      indicator: [
        { name: "考勤", max: 6500 },
        { name: "工作效率", max: 16000 },
        { name: "正确率", max: 30000 },
        { name: "自主学习", max: 38000 },
        { name: "帮助同事", max: 52000 },
        { name: "积极性", max: 25000 }
      ],
      series: [
        {
          name: "李四",
          type: "radar",
          // areaStyle: {normal: {}},
          data: [
            {
              value: [4300, 10000, 2800, 35000, 5000, 19000]
            },
            {
              value: [5000, 14000, 2800, 3100, 42000, 21000]
            }
          ]
        }
      ]
    };
  },
  name: "",
  mounted() {
    const echarts = require("echarts");
    var dom = document.getElementById("container");

    var myChart = echarts.init(dom);
    var app = {};

    var option;

    option = {
      title: {
        text: "基础雷达图"
      },
      tooltip: {},
      legend: {
        data: ["预算分配（Allocated Budget）", "实际开销（Actual Spending）"]
      },
      radar: {
        // shape: 'circle',
        name: {
          textStyle: {
            color: "#fff",
            backgroundColor: "#999",
            borderRadius: 3,
            padding: [3, 5]
          }
        },
        indicator: this.indicator
      },
      series: this.series
    };

    if (option && typeof option === "object") {
      myChart.setOption(option);
    }
  }
};
</script>
<style>
.radar-echart {
  width: 600px;
  height: 400px;
}
</style>
